[#-- freemarker page demo --]

[#-- 本页面使用DateTables.js 自动分页 --]
[#if pageSupport ??]
  [#assign x=(pageSupport.getTotalPage())!1 /]
  [#assign y=pageSupport.getCurrentPage() /]
  [#assign z=(page.pageSupport.getPageSize())!1 /]
  [#assign renderTo=(table.renderTo)!'' /]
 	<script type="text/javascript">//<![CDATA[
		// ajax分页：
		[#if ajax==true]
		var baseTable = (function(){
			function _addEventListeners() {
				$('a[page]').unbind('click').click(function() {
					var page = $(this).attr('page');
					$.get(baseTable.config.url, {'ajax':true, 'piece':true, 'currentPage':page}, function(data){
						//
						$(baseTable.config.renderTo).html(data);
						_addEventListeners();
						//
					})
				})
			}
			return {
				 config: {
                	url : null,
                	renderTo: null,
                    theme: null
                },
                init: function () {
                    _addEventListeners();
                }
			}
		}());
		$(function() {
			//var parent = $('#${table.id}').parent().html();
			baseTable.config.url = "${page.url}" ;
			baseTable.config.theme = '';
			baseTable.config.renderTo= "${renderTo!'#articleList'}";
			baseTable.init();
		})
		[/#if]
		//]]>
	</script>
	
[/#if]
					<table cellpadding="0" cellspacing="0" border="0" class="stdtable" id="dyntable">
						[#if x lte 0]
							[#assign x=1]
						[/#if]
						[#if (table.columnList) ?? ]
	                    	<colgroup>
	                    		<col class="con1" />
								[#list table.columnList as head]
									<col class="[#if head_index%2==0]con0[#else]con1[/#if]" />
									[#--<th class="${head.headerClass!''}">${head.title}</th>--]
								[/#list]
							</colgroup>
							<thead>
		                        <tr>
		                        [#list table.columnList as head]
		                        	<th class="[#if head_index%2==0]head0[#else]head1[/#if] ${head.headerClass!''}">${head.title}</th>
								[/#list]
		                        </tr>
							</thead>
							<tfoot>
		                        <tr>
		                        [#list table.columnList as head]
		                        	<th class="[#if head_index%2==0]head0[#else]head1[/#if] ${head.headerClass!''}">${head.title}</th>
								[/#list]
		                        </tr>
							</tfoot>
							<tbody>
								[#--[#assign blank=z/]--]
								[#list table.source as target]
									<tr>
										[#list table.columnList as column]
												[#if column.innerHtml?? ]
													<td class="${column.columnClass}" [#if column.property ??]tval="${displayer.property("[${target_index}].${column.property}", "")}"[/#if] >
														${column.innerHtml}
													</td>
												[#else]
													<td class="${column.columnClass}">
														${displayer.property("[${target_index}].${column.property}", "${column.format}")}
													</td>
												[/#if]
										[/#list]
									</tr>
									[#--[#assign blank=z-target_index> --]
								[/#list]
								[#-- 不足分页内容,补齐空白行
								[#list 1..blank as t]
									<tr>
										[#list table.columnList as column]
											<td class="${column.columnClass}">
												&nbsp;
											</td>
										[/#list]
									</tr>
								[/#list] --]
							</tbody>
						[/#if]
					</table>
                <br /><br />
